<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored ="false"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<title>北京市电子行政监察平台-修改会议</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link href="<%=path%>/css/base.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/css/frame.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/css/style.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/css/jquery.treeview.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/css/jQueryTree-1.2.1.css" rel="stylesheet" type="text/css" />
		<%@ include file="../../conference_getOnlineInfoFromSession.jsp"%> 
		<script type="text/javascript">
			var path = "<%=path%>";
		</script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery-1.4.3.pack.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery-jtemplates.pack.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery.form.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery.metadata.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery.validate.fixed.pack.js"></script>
		<!-- 联系人 -->
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery.treeview.pack.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/oacore.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/jQueryTree-1.2.1.min.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/AccountBook2.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/util.js"></script>
		<!-- end  -->
		<!-- 时间选择器 -->
		<script language="javascript" type="text/javascript" src="<%=path%>/javascript/My97DatePicker/WdatePicker.js"></script>
		<!-- end -->
		<script type="text/javascript" src="<%=path%>/javascript/system/init.js"></script>
		<!-- 在线文档 -->
		<script type="text/javascript" src="<%=path%>/javascript/webOffice/commons.js"></script>
		<script type="text/javascript">
		var accountBookJsonStr = "<%=((String)request.getAttribute("userInfoString"))%>";
			$(function () {
				//初始化联系人
				new AccountBook({
						input: $(".use-account-book"),
						mode: "checkbox",
						defaultValue: [<s:property value='schemeTransientStoreDTO.commandPersonDTO.userInfoId' />],
						data: $.parseJSON(accountBookJsonStr),
						pretreatment: function (data) {
							data.content = data.userName;
							delete data.userName;
							data.id = data.userInfoId;
							delete data.userInfoId;
							return data;
						}
					});
				
				    
					//初始化去向选择器
					var selector = $("input.nextstep-option").bind("click", function () {
						var $this = $(this);
						if($this.hasClass("nextstep-option-submit"))
						{
							$("tr.nextstep-sure").hide();
							$("tr.nextstep-submit").show();
							$("#note").val("").addClass("ignore");
							$("#accountBook").removeClass("ignore");
						}
						else if($this.hasClass("nextstep-option-sure"))
						{
							$("tr.nextstep-submit").hide();
							$("tr.nextstep-sure").show();
							$("#accountBook").val("").addClass("ignore");
							$("#note").val("").removeClass("ignore");
							
						}
						else if($this.hasClass("nextstep-option-promotion"))
						{
							$("tr.nextstep-submit").hide();
							$("tr.nextstep-sure").hide();
							$("#note").val("").addClass("ignore");
							$("#accountBook").val("").addClass("ignore");
						}
						});
					//触发选择
					selector.filter(":checked").trigger("click");

					 $("select#import option[value='${schemeTransientStoreDTO.importanceDTO.dataValueId}']").attr("selected", "selected");
				     $("input[type=radio][value=${schemeTransientStoreDTO.nextStep}]").attr("checked",true);
				     if("${schemeTransientStoreDTO.nextStep}" == "SUBMIT_APPROVAL"){
				    	    $("tr.nextstep-sure").hide();
							$("tr.nextstep-submit").show();
					  }else if("${schemeTransientStoreDTO.nextStep}" == "DIRECT_FINALIZED"){
						    $("tr.nextstep-submit").hide();
							$("tr.nextstep-sure").show();
					  }else if("${schemeTransientStoreDTO.nextStep}" == "JUMP_ACTION"){
						    $("tr.nextstep-submit").hide();
							$("tr.nextstep-sure").hide();
					  }
				});
		</script>
		<script type="text/javascript">
			$(function(){

				//给select加上对应version
				$("select.need-version").bind("change", function () {
						var $this = $(this);
						var versionName = $this.attr("hiddenVersionName");
						var version = $(this.options[this.selectedIndex]).attr("version");
						var versionHidden = $("input[name='"+ versionName +"']");
						if(versionHidden.size() <= 0)
							$("<input type='hidden' value='"+ version +"' name='" + versionName + "'/>").appendTo($this.parents("form:first"));
						else
						{
							versionHidden.val(version);
						}
					}).trigger("change");

			});

			
			
		</script>
		<style type="text/css">
			div {
				position: static;
			}
		</style>
	</head>
	<body onunload="UnLoad();">
		<div id="mainPage" class="surround-layout">
			<jsp:include page="/jsp/frame/top.jsp" flush="true"></jsp:include>
			<div class="middle">
				<s:if test="fromFlag=='task'">
					<jsp:include page="../../../frame/middle_left.jsp" flush="true">
						<jsp:param value="1001-1034" name="view"/>
					</jsp:include>
				</s:if>
				<s:else>
					<jsp:include page="../../../frame/middle_left.jsp" flush="true">
						<jsp:param value="1018-1034" name="view"/>
					</jsp:include>
				</s:else>
				<!-- 右侧输出内容 -->
				<div class="right">
					<div class="right-all-content">
						<div>
							<div class="content-line-wrap">
								<div class="content-line-left content-line">
									<h1 class="content-title">
										<span>
											<a href="<%=path %>/web/toUserAccountListAction.action">文档起草</a>
										</span>
										<span>
											&gt;&gt;
										</span>
										<span>
											<a href="<%=path %>/web/toCreatePageAction.action">修改文档</a>
										</span>
									</h1>
								</div>
							</div>
							<div class="inner-dialog">
								<form method="post" name="webform" id="creatorForm" onsubmit="SaveDocument();" class="normal-form use-def-validate" action="<%=path%>/web/saveOrUpdateAction.action">
									<input type="hidden"  name="schemeTransientStoreDTO.schemeTransientStoreId" id="schemeTransientStoreId" value="${schemeTransientStoreDTO.schemeTransientStoreId }"/>
									<input type="hidden"   name="onlinePath" id="path"/>
									<input type="hidden"   name="onlineVersion" id="documentVersion"/>
									<input type="hidden" name="fromFlag" value="${fromFlag }">
									<input type="hidden" value="${schemeTransientStoreDTO.jobId}" name="schemeTransientStoreDTO.jobId"/>
									<h1 class="inner-dialog-title">
										<span style="float: left;">修改文档</span>
										<span style="float: left;margin-top: -4px;margin-left: 16px;">
										   <s:if test="jobId !=null ">
										      <input type="submit" value="保存" class="special green-button-sa" style="width: 48px;" onclick="$('#creatorForm').attr('action', '<%=path%>/web/saveOrUpdateAction.action?jobId='+${jobId});"/>
										   </s:if>
										   <s:else>
										      <input type="submit" value="保存" class="special green-button-sa" style="width: 48px;" onclick="$('#creatorForm').attr('action', '<%=path%>/web/saveOrUpdateAction.action');"/>
										   </s:else>
											
										</span>
									</h1>
									<div class="inner-dialog-content">
										<h1 class="inner-form-title">文档任务信息</h1>
									<!--判断是从任务进还从会议发起 进 -->	
									<s:if test="jobId !=null ">
										<table class="data-view-table tiny-form-table" cellspacing="0">
											<tbody>
												<tr class="odd two-field">
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														文档任务名称:
													</td>
													<td colspan="3" class="dvt-value">
														<input type="text" name=" "   class="shadow tft-textinput {required: true, dataName: true, maxlength: 32, messages: {required: '任务名称项为必填', maxlength: '任务名称项的长度不能超过32个字符', dataName: '任务名称的格式须为中英文、数字及下划线'}}" value="${schemeTransientStoreDTO.conferenceName}" disabled="disabled"/>
													</td>
												</tr>
												<tr class="even two-field">
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														来源:
													</td>
													<td class="dvt-value">
														<input type="text" name=" " hiddenVersionName="schemeTransientStoreDTO.importanceDTO.version" class="tft-select need-version {required: true , messages: {required: '来源为必选项'}}" id="import" value="${schemeTransientStoreDTO.importanceDTO.value}" disabled="disabled"/>
													</td>
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														任务计划结束日期:
													</td>
													<td class="dvt-value">
														<input type="text" name=" "  class="shadow tft-textinput use-def-datepicker {required: true , messages: {required: '计划结束日期为必填'}}" value="${planEndTime}" disabled="disabled"/>
													</td>
												</tr>
												<tr class="odd two-field">
													<td class="dvt-filed">
														任务描述:
													</td>
													<td colspan="3" class="dvt-value">
														<textarea class="shadow tft-textarea {maxlength: 64, messages: {maxlength: '任务描述项的长度不能超过64个字符'}}" name=" " disabled="disabled">${schemeTransientStoreDTO.description }</textarea>
													</td>
												</tr>
											</tbody>
										</table>
										</s:if>
										<s:else>
										  	<table class="data-view-table tiny-form-table" cellspacing="0">
											<tbody>
												<tr class="odd two-field">
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														文档任务名称:
													</td>
													<td colspan="3" class="dvt-value">
														<input type="text" name="schemeTransientStoreDTO.conferenceName"   class="shadow tft-textinput {required: true, dataName: true, maxlength: 32, messages: {required: '任务名称项为必填', maxlength: '任务名称项的长度不能超过32个字符', dataName: '任务名称的格式须为中英文、数字及下划线'}}" value="${schemeTransientStoreDTO.conferenceName}"/>
													</td>
												</tr>
												<tr class="even two-field">
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														来源:
													</td>
													<td class="dvt-value">
														<select name="schemeTransientStoreDTO.importanceDTO.dataValueId" hiddenVersionName="schemeTransientStoreDTO.importanceDTO.version" class="tft-select need-version {required: true , messages: {required: '来源为必选项'}}" id="import">
															<s:if test="importanceList">
																<s:iterator id="importance" value="importanceList">
																	<option value="${importance.dataValueId}" version="${importance.version }">${importance.value}</option>
																</s:iterator>
															</s:if>
														</select>
													</td>
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														任务计划结束日期:
													</td>
													<td class="dvt-value">
														<input type="text" name="schemeTransientStoreDTO.planEndDate"  class="shadow tft-textinput use-def-datepicker {required: true , messages: {required: '计划结束日期为必填'}}" value="${dateTime}"/>
													</td>
												</tr>
												<tr class="odd two-field">
													<td class="dvt-filed">
														任务描述:
													</td>
													<td colspan="3" class="dvt-value">
														<textarea class="shadow tft-textarea {maxlength: 64, messages: {maxlength: '任务描述项的长度不能超过64个字符'}}" name="schemeTransientStoreDTO.description">${schemeTransientStoreDTO.description }</textarea>
													</td>
												</tr>
											</tbody>
										</table>
										</s:else>
										<!-- end -->
										<h1 class="inner-form-title">会议方案<span style="color: #666666;font-size: 13px;">（若不需要会议方案，可直接在下一步去向中选择“发起会议”并提交）</span></h1>
										<div style="height: 540px;">
											<script src="<%=path%>/javascript/webOffice/iWebOffice2009.js"></script>
										</div>
										<table class="data-view-table tiny-form-table" cellspacing="0">
											<tbody>
												<tr class="odd two-field">
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														下一步去向:
													</td>
													<td class="dvt-value">
														<label class="tft-radiolabel odd">
															<input type="radio" name="schemeTransientStoreDTO.nextStep" value="SUBMIT_APPROVAL" class="nextstep-option nextstep-option-submit" checked="checked"/> 提交审批定稿（交给领导审批）
														</label>
														<label class="tft-radiolabel even">
															<input type="radio" name="schemeTransientStoreDTO.nextStep" value="DIRECT_FINALIZED" class="nextstep-option nextstep-option-sure"/> 定稿（直接定稿，建议在文档备注中填写定稿意见文档定稿将失去所有手写批注。）
														</label>
														<label class="tft-radiolabel odd">
															<input type="radio" name="schemeTransientStoreDTO.nextStep" value="JUMP_ACTION" class="nextstep-option nextstep-option-promotion"/> 发起会议（适用于没有会议方案的情况）
														</label>
													</td>
												</tr>
												<tr class="even nextstep-submit two-field" style="display: none;">
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														选择批示人:
													</td>
													<td class="dvt-value">
														<input type="text" id="accountBook" class="shadow use-account-book tft-textinput {required: true, messages: {required: '批示人项为必选'}}" name="schemeTransientStoreDTO.commandPersonDTO.userInfoId"/>
													</td>
												</tr>
												<tr class="even nextstep-sure two-field" style="display: none;">
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														备注:
													</td>
													<td class="dvt-value">
														<textarea id="note" class="shadow tft-textarea {required: true, dataName: true, maxlength: 32, messages: {required: '备注项为必填', maxlength: '备注项的长度不能超过32个字符', dataName: '备注的格式须为中英文、数字及下划线'}}" name="schemeTransientStoreDTO.note">${schemeTransientStoreDTO.note}</textarea>
													</td>
												</tr>
											</tbody>
										</table>
										<table>
											<tr>
												<td>
												<s:if test="jobId !=null ">
												   <input type="submit" value="确定" class="special originate" onclick="$('#creatorForm').data('stopAutoSave', true);$('#creatorForm').attr('action', '<%=path%>/web/schemeSimulateSubmitAction.action?jobId='+${jobId});"></input>
												</s:if>
												<s:else>
												   <input type="submit" value="确定" class="special originate" onclick="$('#creatorForm').data('stopAutoSave', true);$('#creatorForm').attr('action', '<%=path%>/web/schemeSimulateSubmitAction.action');"></input>
												</s:else>
													
												</td>
											</tr>
										</table>
									</div>
								</form>
							</div>
						</div>
					</div>
				</div>
				<!--  -->
			</div>
		</div>
	</body>
</html>